package com.game.worm.mobile.view.common;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.dx.as.fragment.TFragment;
import com.game.worm.mobile.R;
import com.game.worm.mobile.view.home.adpater.GamedAdpater;

/**
 * Created by d_xxiang on 2018/5/22.
 */

public class CommonFragment extends TFragment{
    public GamedAdpater adpater;
    public OnFragmentHideListener onFragmentHideListener;
    @Override
    public void initView() {
        RecyclerView recyclerView = findView(R.id.recyclerview);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(linearLayoutManager);
        adpater = new GamedAdpater(getActivity());
        recyclerView.setAdapter(adpater);
    }

    public void setOnFragmentHideListener(OnFragmentHideListener onFragmentHideListener){
        this.onFragmentHideListener = onFragmentHideListener;
    }

    @Override
    public void onHiddenChanged(boolean hidden) {
//        super.onHiddenChanged(hidden);
        this.onFragmentHideListener.onChildHiddenChanged(hidden);
    }

    @Override
    public int setLayoutI() {
        return R.layout.item_fragment_type_list;
    }

    @Override
    public void dataOpion() {

    }

    @Override
    public void initRpo() {

    }
}
